package 组成字符串ku的最大次数.src.main;

public class Main {
    public static int solution(String s) {
        // write code here
        int nums = 0;
        s = s.toLowerCase();
        int k_nums = 0;
        int u_nums = 0;
        for (int i = 1; i <= s.length(); i++) {
            if ('k' == s.charAt(i - 1)) {
                k_nums++;
            }

            if ('u' == s.charAt(i - 1)) {
                u_nums++;
            }

        }
        nums = Math.min(k_nums, u_nums);

        return nums;
    }

    public static void main(String[] args) {
        System.out.println(solution("AUBTMKAxfuu"));
        System.out.println(solution("KKuuUuUuKKKKkkkkKK"));
        System.out.println(solution("abcdefgh"));
        // System.out.println(solution("AUBTMKAxfuu") == 1);
        // System.out.println(solution("KKuuUuUuKKKKkkkkKK") == 6);
        // System.out.println(solution("abcdefgh") == 0);
    }
}